package Person.File;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class JAVAIODemo {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        File file = new File("D:"+File.separator+"hello"+File.separator

        +"demo"+File.separator+"message"+File.separator+"ith.txt");
        if(!file.getParentFile().exists()){
            file.getParentFile().mkdirs();
        }
        if(file.exists()){
            file.delete();
        }else{
            System.out.println(file.createNewFile());
        }
    }
}
